package com.aegean.MonitorExamSYS.monitor.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
@Controller("MonitorExit")
@Scope("prototype")
public class MonitorExit extends ActionSupport implements ServletRequestAware{
	   /**
	 * 
	 */
	private static final long serialVersionUID = 2781214795502578762L;
	private HttpServletRequest request;
	    private HttpSession session;
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		session=request.getSession();
		if(session.getAttribute("MonitorLogin")!=null){
			session.removeAttribute("MonitorLogin");
			return SUCCESS;
		}
		else 
			return ERROR;
	}
	@Override
	public void setServletRequest(HttpServletRequest arg0) {
		// TODO Auto-generated method stub
		this.request=arg0;
		
	}
	

}
